﻿#include <iostream>
using namespace std;
const static double PI = 3.14;
class Shape {
public:
	virtual double Area() const = 0;
	virtual void Show() = 0;
	void setColor(int color) {
		_color = color;
	}
	void Display() {
		cout << Area() << endl;
	}
private:
	int _color;
};
class Circle : public Shape {
public:
	Circle(double radius) :_radius(radius) {};
	double Area() const {
		return _radius * _radius * PI;
	}
	void Show() {
		cout << "Circle" << endl;
	}
private:
	double _radius;
};
class RectAngle : public Shape {
public:
	RectAngle(double length) :_length(length) {};
	double Area() const {
		return _length * _length;
	}
	void Show() {
		cout << "RectAngle" << endl;
	}
private:
	double _length;
	2
};
int main()
{
	Circle c(2);
	RectAngle d(3);
	Shape* shapes[2];
	shapes[0] = &c;
	shapes[1] = &d;
	for (int index = 0; index < 2; ++index) {
		shapes[index]->Display();
	}
	cout << endl;
}
